﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace The_Last_Knights.GUI
{
    public class Checkbox: Groupbox
    {
        #region Attributes
        protected CheckButton _button;
        protected Label _label;
#endregion

        #region Properties
        public CheckButton Button
        {
            get { return _button; }
            set { _button = value; }
        }

        public Label Label
        {
            get { return _label; }
            set { _label = value; }
        }
#endregion
        public Checkbox(Game game, string ID, Vector2 pos, Vector2 size, Texture2D background, CheckButton checkButton, Label text) 
            : base(game, ID, pos, size, background)
        {            
            _button = checkButton;
            _label = text;
        }

        public override void Update(GameTime gameTime)
        {
            _button.Update(gameTime);
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            _button.Draw(gameTime);
            SpriteBatch sb = GetSpriteBatch();
            if (sb != null)
                _label.Draw(sb, new Vector2(_position.X + _button.Size.X, _label.Position.Y), Color.White);
        }
    }
}
